﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ChildForm.aspx.cs" Inherits="pages_Demo_rowEdit_ChildForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>添加数据</title>
    
       <script language="javascript" type="text/javascript">
       function selectAll(obj)
       {
           var theTable     = obj.parentElement.parentElement.parentElement;
           var i;
           var j = obj.parentElement.cellIndex;
        
           for(i=0;i<theTable.rows.length;i++)
           {
               var objCheckBox = theTable.rows[i].cells[j].firstChild;
               if(objCheckBox.checked!=null)objCheckBox.checked = obj.checked;
           }
       }
       </script>
 <base target="_self" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="GridView1" runat="server" BackColor="White" BorderColor="#CCCCCC"
            BorderStyle="None" BorderWidth="1px" CellPadding="3" AutoGenerateColumns="False" OnDataBinding="GridView1_DataBinding" OnRowDataBound="GridView1_RowDataBound">
            <Columns>
                   <asp:TemplateField>
                       <ItemTemplate>
                           <asp:CheckBox ID="chkPKID" runat="server" Checked="True" />
                           <asp:HiddenField ID="hfdPKID" runat="server" Value='<%#DataBinder.Eval(Container.DataItem,"SID") %>' />
                       </ItemTemplate>
                       <HeaderTemplate>
                           &nbsp;<input id="CheckAll" type="checkbox" onclick="selectAll(this);" />全选
                       </HeaderTemplate>
                   </asp:TemplateField>
                    
                   <asp:BoundField DataField="SID" HeaderText="SID" InsertVisible="False" ReadOnly="True"
                       SortExpression="SID" />
                   <asp:BoundField DataField="SName" HeaderText="SName" SortExpression="SName" />
                   <asp:BoundField DataField="SName" HeaderText="SName" SortExpression="SName" />
                
                <asp:TemplateField HeaderText="成绩">
                    <ItemTemplate>
                        <asp:TextBox ID="txtSource" runat="server"  Width="84px">0</asp:TextBox>
                    </ItemTemplate>
                </asp:TemplateField>
                
            </Columns>
            <FooterStyle BackColor="White" ForeColor="#000066" />
            <RowStyle ForeColor="#000066" />
            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
        </asp:GridView>
        <br />
        <asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" Text="确定" Width="121px" /></div>
    </form>
</body>
</html>

